﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package Classes.util {
    import __AS3__.vec.*;

    public class BackgroundInitialization {

        private static var items_initialized:Boolean = false;
        private static var items_list:Vector.<String> = null;
        private static var items_index:int = 0;

        public static function process():void{
            var _local1:XMLList;
            var _local2:XML;
            if (!items_initialized){
                if (!OptimizationConfig.enableItemLoading){
                    items_initialized = true;
                    return;
                };
                if (items_list == null){
                    _local1 = Global.gameSettings.getItems();
                    items_list = new Vector.<String>();
                    for each (_local2 in _local1) {
                        items_list.push(_local2.attribute("name").toString());
                    };
                    items_index = 0;
                } else {
                    if (items_index < items_list.length){
                        Global.gameSettings.getItemByName(items_list[items_index]);
                        items_index++;
                    } else {
                        items_initialized = true;
                    };
                };
            };
        }

    }
}//package Classes.util 
